﻿
using HSGD.IRepository.BASE;
using HSGD.IServices.HSGD_Staff;
using HSGD.Services.BASE;
using HSGD.Model.Models.HSGD_Staff;
using HSGD.Model.Dtos.HSGD_Staff;
using AutoMapper;
using HSGD.Common.Attributes;
using HSGD.Common.DB;

namespace HSGD.Services.HSGD_Staff;
public class PersonEducationInfoServices : BaseServices<PersonEducationInfo>, IPersonEducationInfoServices {
    private readonly IBaseRepository<PersonEducationInfo> _dal;
    IMapper _mapper;

    public PersonEducationInfoServices(IBaseRepository<PersonEducationInfo> dal, /*IRefEmailNoticeServices refEmailNoticeServices,*/ IMapper mapper) {
        //_refEmailNoticeServices = refEmailNoticeServices;
        this._dal = dal;
        base.BaseDal = dal;
        _mapper = mapper;
    }


    [UseTran(Propagation = Propagation.Required)]
    public async Task<PersonEducationInfoDto> AddAsync(PersonEducationInfo input) {
        var data = await Db.Insertable(input).ExecuteReturnEntityAsync();
        return _mapper.Map<PersonEducationInfoDto>(data);
    }
}